export interface templateAccount {
  account: number | string;
  password: number | string;
  verifyText: number | string;
  verifyToken: number | string;
}

/**
 * 获取二维码状态 接口查询参数
 */
export interface IQRCodeStatusData {
  qrCode: string;
  tag: string;
}

export interface IQRCodeStatusRes {
  status: "wait" | "scanned" | "finished"; // 二维码状态
  sessionUser: ISessionUser; // 如果二维码状态是finish，则返回登陆成功的信息
}

/**
 * 登录信息
 */
export interface ISessionUser {
  secret: string;
  token: string;
  userId: number;
  merchantId: number;
  username: string;
  currentService: any;
  allPermission: any;
  adminType: any;
  insId: number;
  bindWx: number;
  secretEnabled: boolean;
  bindWxPromptStatus: number;
}

/**
 * 生成二维码接口的查询参数
 */
export interface IQRCodeData {
  app:
    | "activity"
    | "material"
    | "reach"
    | "mall"
    | "backstage"
    | "merchant"
    | "store"
    | "user"
    | "flow";
}

/**
 * 生成二维码接口的响应内容
 */
export interface IQRCodeRes {
  qrCode: string; // 二维码内容
  tag: string; // 标记，需要在整个登陆过程中传递
}

/**
 * 选择账号接口的查询参数
 */
export interface ISelectAccountsData {
  wxCode: string; // 微信code
  tag: string; // 标记
  app: "merchant";
}

/**
 * 选择账号接口的响应内容
 */
export interface ISelectAccountsRes {
  certificate: string;
  merchantAccounts: IAccMerchant[];
}

export interface IAccMerchant {
  name: string;
  ins: IAccIns[];
}

export interface IAccIns {
  name: string;
  accounts: IAccount[];
}

export interface IAccount {
  name: string;
  account: string;
}

/**
 * 通过QRCode登录
 */
export interface ILoginByQRCodeData {
  certificate: string;
  account: string;
}

export interface IUpdatePasswordData {
  oldPassword: string;
  newPassword: string;
}
